home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / elv18src.zip / config.h < prev    next >
C/C++ Source or Header  |  1994-01-13  |  18KB  |  762 lines

  1. /*
  2.  * vi configuration file
  3.  * We try to automatically configure to various compilers and operating
  4.  * systems. Extend the autoconf section as needed.
  5.  */
  6.  
  7. #ifndef _CONFIG_H
  8. # define _CONFIG_H
  9.  
  10. /*************************** autoconf section ************************/
  11.  
  12. /* Commodore-Amiga */
  13. #ifdef    amiga
  14. # define AMIGA        1
  15. # define COMPILED_BY    "Manx Aztec C 5.2b"
  16. # define TINYSTACK    1
  17. #endif
  18.  
  19. /* standard unix V (?) */
  20. #ifdef    M_SYSV
  21. # define UNIXV        1
  22. # ifdef M_XENIX
  23. #  ifndef M_I386
  24. #   define TINYSTACK    1
  25. #  endif
  26. # endif
  27. # undef COHERENT
  28. #endif
  29.  
  30. /* HPUX 8.07 */
  31. #ifdef hpux
  32. # define UNIXV        1
  33. # define TERMIOS    1
  34. #endif
  35.  
  36. /* linux */
  37. #ifdef linux
  38. # define UNIXV        1
  39. # define TERMIOS    1
  40. # define LINUX        1
  41. #endif
  42.  
  43. /* xelos system, University of Ulm */
  44. #ifdef    xelos
  45. # define UNIXV        1
  46. #endif
  47.  
  48. /* BSD UNIX? */
  49. #ifdef bsd
  50. # define BSD        1
  51. #else
  52. # ifdef sun
  53. #  ifndef M_SYSV
  54. #   define BSD        1
  55. #  endif
  56. # endif
  57. # ifdef __386BSD__
  58. #  define BSD        1
  59. # endif
  60. #endif
  61.  
  62. /* Microsoft C: sorry, Watcom does the same thing */
  63. #ifdef    M_I86
  64. # ifndef M_SYSV
  65. #  define MSDOS        1
  66. #  ifdef IBMC2
  67. #   define COMPILED_BY    "IBM C/2 1.00"
  68. #  else
  69. #   define MICROSOFT    1
  70. #   define COMPILED_BY    "Microsoft C 5.10"
  71. #  endif
  72. #  define TINYSTACK    1
  73. # endif
  74. #endif
  75.  
  76. /* Borland's Turbo C */
  77. #ifdef    __TURBOC__
  78. # define MSDOS        1
  79. # define TURBOC        1
  80. # ifdef __BORLANDC__
  81. #  define COMPILED_BY    (__BORLANDC__ == 0x0200 ? "Borland C++ 2.00" :         \
  82.                (__BORLANDC__ == 0x0400 ? "Borland C++ 3.0" :     \
  83.                   (__BORLANDC__ == 0x0410 ? "Borland C++ 3.1" :  \
  84.                  "Borland C++ > 3.1!" ) ) )
  85. # else
  86. #  define COMPILED_BY    (__TURBOC__ >= 661 ? "Turbo C++ 1.00" : "Turbo C 2.00")
  87. # endif
  88. # define TINYSTACK    1
  89. #endif
  90.  
  91. /* Tos Mark-Williams */
  92. #ifdef    M68000
  93. # define TOS 1
  94. # define COMPILED_BY    "Mark Williams C"
  95. # define TINYSTACK    1
  96. #endif
  97.  
  98. /* Tos GNU-C */
  99. #ifdef __atarist__
  100. # ifdef __gem__
  101. #  define TOS 1
  102. #  define COMPILED_BY    "GNU-C " __VERSION__
  103. #  define TINYSTACK    1
  104. # endif
  105. #endif
  106.  
  107. /* OS9/68000 */
  108. #ifdef    OSK
  109. # define COMPILED_BY    "Microware C V2.3 Edition 40"
  110. # define TINYSTACK    1
  111. #endif
  112.  
  113. /* DEC Rainbow, running MS-DOS (handled by earlier MS-DOS tests) */
  114. /* (would need -DRAINBOW in CFLAGS to compile a Rainbow-compatible .EXE) */
  115.  
  116. #if VMS
  117. # define COMPILED_BY    "VAX/VMS VAXC compiler"
  118. # undef VMS
  119. # define VMS 1
  120. #endif
  121.  
  122. #ifdef __EMX__
  123. # define COMPILED_BY    "emx+gcc " __VERSION__ " on " __DATE__
  124. #endif
  125.  
  126.  
  127. #ifdef COHERENT
  128. # ifdef _I386
  129. #  define COH_386 1
  130. #  define COH_286 0
  131. # else
  132. #  define COH_386 0
  133. #  define COH_286 1
  134. # endif
  135. # undef COHERENT
  136. # define COHERENT 1
  137. #endif
  138.  
  139. /*************************** end of autoconf section ************************/
  140.  
  141. /* All undefined symbols are defined to zero here, to allow for older    */
  142. /* compilers which dont understand #if defined() or #if UNDEFINED_SYMBOL */
  143.  
  144. /*************************** operating systems *****************************/
  145.  
  146. #ifndef    BSD
  147. # define BSD    0        /* UNIX - Berkeley 4.x */
  148. #endif
  149.  
  150. #ifndef    UNIXV
  151. # define UNIXV    0        /* UNIX - AT&T SYSV */
  152. #endif
  153.  
  154. #ifndef    UNIX7
  155. # define UNIX7    0        /* UNIX - version 7 */
  156. #endif
  157.  
  158. #ifndef    MSDOS
  159. # define MSDOS    0        /* PC DOS*/
  160. #endif
  161.  
  162. #ifndef    OS2
  163. # define OS2    0        /* OS2 */
  164. #endif
  165.  
  166. #ifndef    TOS
  167. # define TOS    0        /* Atari ST */
  168. #endif
  169.  
  170. #ifndef    AMIGA
  171. # define AMIGA    0        /* Commodore Amiga */
  172. #endif
  173.  
  174. #ifndef OSK
  175. # define OSK    0        /* OS-9 / 68k */
  176. #endif
  177.  
  178. #ifndef COHERENT
  179. # define COHERENT 0        /* Coherent */
  180. #endif
  181.  
  182. #ifndef LINUX
  183. # define LINUX 0        /* Linux */
  184. #endif
  185.  
  186. #ifndef RAINBOW            /* DEC Rainbow support, under MS-DOS */
  187. # define RAINBOW 0
  188. #endif
  189.  
  190. #ifndef VMS
  191. # define VMS 0                  /* VAX/VMS */
  192. #endif
  193.  
  194. #ifndef OS2
  195. # define OS2 0                  /* PC OS/2 */
  196. #endif
  197.  
  198.                 /* Minix has no predefines */
  199. #if !BSD && !UNIXV && !UNIX7 && !MSDOS && !TOS && !AMIGA && !OSK && !COHERENT && !VMS && !LINUX && !OS2
  200. # define MINIX    1
  201. #else
  202. # define MINIX    0
  203. #endif
  204.  
  205.                 /* generic combination of Unices */
  206. #if UNIXV || UNIX7 || BSD || MINIX || COHERENT || LINUX
  207. # define ANY_UNIX 1
  208. #else
  209. # define ANY_UNIX 0
  210. #endif
  211.  
  212. #ifndef TINYSTACK
  213. # define TINYSTACK 0
  214. #endif
  215.  
  216. #ifdef TERMIOS
  217. # define TERMIOS 1
  218. #else
  219. # define TERMIOS 0
  220. #endif
  221.  
  222. /*************************** compilers **************************************/
  223.  
  224. #ifndef    AZTEC_C
  225. # define AZTEC_C    0
  226. #endif
  227.  
  228. #ifndef    MICROSOFT
  229. # define MICROSOFT    0
  230. #endif
  231.  
  232. #ifndef    TURBOC
  233. # define TURBOC        0
  234. #endif
  235.  
  236. /* Should we use "new style" ANSI C prototypes? */
  237. #ifdef __STDC__
  238. # define NEWSTYLE 1
  239. #endif
  240. #ifdef __cplusplus
  241. # define NEWSTYLE 1
  242. #endif
  243. #ifdef __TURBOC__
  244. # define NEWSTYLE 1
  245. #endif
  246. #ifndef NEWSTYLE
  247. # define NEWSTYLE 0
  248. #endif
  249.  
  250. #if NEWSTYLE
  251. # define P_(s) s
  252. #else
  253. # define P_(s) ()
  254. #endif
  255.  
  256.  
  257. /* Do we have standard C headers? */
  258. #ifdef __STDC__
  259. # define HAS_STDLIB 1
  260. #endif
  261. #ifdef __TURBOC__
  262. # define HAS_STDLIB 1
  263. #endif
  264. #ifndef HAS_STDLIB
  265. # define HAS_STDLIB 0
  266. #endif
  267.  
  268.  
  269. /******************************* Credit ************************************/
  270.  
  271. #if MSDOS
  272. # define CREDIT "Ported to MS-DOS by Guntram Blohm & Martin Patzel"
  273. # ifdef RAINBOW
  274. #  define CREDIT2 "Rainbow support added by Willett Kempton"
  275. # endif
  276. #endif
  277.  
  278. #if AMIGA
  279. # define CREDIT "Ported to AmigaDOS 2.04 by Mike Rieser & Dale Rahn"
  280. #endif
  281.  
  282. #if TOS
  283. # define CREDIT "Ported to Atari/TOS by Guntram Blohm & Martin Patzel"
  284. #endif
  285.  
  286. #if OSK
  287. # define CREDIT    "Ported to Microware OS9/68k by Peter Reinig"
  288. #endif
  289.  
  290. #if COHERENT
  291. # define CREDIT    "Ported to Coherent by Esa Ahola"
  292. #endif
  293.  
  294. #if VMS
  295. # define CREDIT "Ported to VAX/VMS by John Campbell"
  296. #endif
  297.  
  298. #if OS2
  299. # define CREDIT "Ported to OS/2 by Kai Uwe Rommel & Greg Roelofs"
  300. #endif
  301.  
  302.  
  303. /**************************** Compiler quirks *********************************/
  304.  
  305. /* the UNIX version 7 and (some) TOS compilers, don't allow "void" */
  306. #if UNIX7 || TOS
  307. # define void int
  308. #endif
  309.  
  310. /* as far as I know, all compilers except version 7 support unsigned char */
  311. /* NEWFLASH: the Minix-ST compiler has subtle problems with unsigned char */
  312. #if UNIX7 || MINIX
  313. # define UCHAR(c)    ((c) & 0xff)
  314. # define uchar        char
  315. #else
  316. # define UCHAR(c)    ((unsigned char)(c))
  317. # define uchar        unsigned char
  318. #endif
  319.  
  320. /* UNIX declares lseek in <unistd.h>.  Everybody else (except Amiga) wants
  321.  * lseek declared here.  Note: "off_t" may be preferable to "long".
  322.  */
  323. #if ANY_UNIX
  324. # include <sys/types.h>
  325. # include <unistd.h>
  326. #else
  327. # if !AMIGA
  328. extern long lseek();
  329. # endif
  330. #endif
  331.  
  332. /* Some compilers prefer to have malloc declared as returning a (void *) */
  333. /* ANSI, on the other hand, needs the arguments to free() to be cast */
  334. #if !HAS_STDLIB
  335. # if BSD || AMIGA || MINIX
  336. extern void *malloc();
  337. #  define _free_(ptr)    free((void *)ptr)
  338. # else
  339. extern char *malloc();
  340. #  define _free_(ptr)    free((char *)ptr)
  341. # endif
  342. #else
  343. # define _free_(ptr)    free((void *)ptr)
  344. #endif    /* __STDC__ */
  345.  
  346. /* ANSI C has getenv() and atol() declared in stdlib.h, which we've already
  347.  * included.  Other compilers will need them declared here, though.
  348.  */
  349. #if !HAS_STDLIB
  350. extern char *getenv();
  351. extern long atol();
  352. #endif
  353.  
  354. /* Signal handler functions used to return an int value, which was ignored.
  355.  * On newer systems, signal handlers are void functions.  Here, we try to
  356.  * guess the proper return type for this system.
  357.  */
  358. #ifndef __STDC__
  359. # if MINIX || TOS
  360. #  define SIGTYPE int
  361. # endif
  362. #endif
  363. #ifndef SIGTYPE
  364. # define SIGTYPE void
  365. #endif
  366.  
  367. /* There are two terminal-related functions that we need: ttyread() and
  368.  * ttywrite().  The ttyread() function implements read-with-timeout and is
  369.  * a true function on all systems.  The ttywrite() function is almost always
  370.  * just a macro...
  371.  */
  372. #if !TOS && !AMIGA
  373. # define ttywrite(buf, len)    write(1, buf, (unsigned)(len))    /* raw write */
  374. #endif
  375.  
  376. /* The strchr() function is an official standard now, so everybody has it
  377.  * except Unix version 7 (which is old) and BSD Unix (which is academic).
  378.  * Those guys use something called index() to do the same thing.
  379.  */
  380. #if BSD || UNIX7 || OSK
  381. # define strchr    index
  382. # define strrchr rindex
  383. #endif
  384. #if !NEWSTYLE
  385. extern char *strchr();
  386. #endif
  387.  
  388. /* BSD uses bcopy() instead of memcpy() */
  389. #if BSD && !hpux
  390. # define memcpy(dest, src, siz)    bcopy(src, dest, siz)
  391. #endif
  392.  
  393. /* BSD uses getwd() instead of getcwd().  The arguments are a little different,
  394.  * but we'll ignore that and hope for the best; adding arguments to the macro
  395.  * would mess up an "extern" dec